<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>Document</title>
  <style>
    *{
      margin: 0;
      padding: 0;
    }
    body{
      /* height: 200px; */
      background: #333
    }
    div{
      /* height: 100%;
      background: #eee; */
    }
    .wrap{
      background: #efa;
    }
    .main{
      height: 100%;
      background: #a1a;
    }
  </style>
</head>
<body>
  <!-- 元素高度设置百分比，相对于父元素的高度做计算 -->
  <div class="wrap">
    <br/>
    <br/>
    <br/>
    <div class="main"></div>
  </div>
</body>
</html>